package org.aeon.gamechatnest.mapper;

import org.aeon.gamechatnest.dto.AuthorityVo;
import org.aeon.gamechatnest.pojo.RoleAuthority;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 89342
 * @description 针对表【role_authority(角色权限表)】的数据库操作Mapper
 * @createDate 2024-05-09 09:25:50
 * @Entity org.aeon.gamechatnest.pojo.RoleAuthority
 */
@Mapper
public interface RoleAuthorityMapper {
    /**
     * 添加角色权限关联
     *
     * @param roleAuthority
     * @return
     */
    int add(RoleAuthority roleAuthority);

    /**
     * 删除角色权限关联
     *
     * @param roleIds
     */
    int deleteByRoleIds(@Param("roleIds") List<Long> roleIds);

    /**
     * 删除角色权限关联
     *
     * @param roleAuthority
     * @return
     */
    @Delete("DELETE FROM role_authority WHERE role_id = #{roleId} AND authority_id = #{authorityId}")
    int delete(RoleAuthority roleAuthority);
}




